package com.yunhe.openapi.client.fallback;

import com.yunhe.common.model.ResultObject;
import com.yunhe.openapi.client.MeasHistoryClient;
import com.yunhe.openapi.util.FallbackUtil;
import feign.hystrix.FallbackFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

@Component
public class MeasHistoryClientFallback  implements FallbackFactory<MeasHistoryClient> {

    @Override
    public MeasHistoryClient create(Throwable cause) {
        return new MeasHistoryClient(){
            @Override
            public ResponseEntity<ResultObject> getHistoryData(String pointNumbers, String dtime) {
                return FallbackUtil.getDefaultFallBack();
            }
        };
    }
}
